home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
NOVA - For the NeXT Workstation
/
NOVA - For the NeXT Workstation.iso
/
SourceCode
/
AdobeExamples
/
NX_CtlPoints
/
ControlPointWraps.psw
< prev
next >
Wrap
Text File
|
1992-12-19
|
4KB
|
153 lines
/*
* (a) (C) 1990 by Adobe Systems Incorporated. All rights reserved.
*
* (b) If this Sample Code is distributed as part of the Display PostScript
* System Software Development Kit from Adobe Systems Incorporated,
* then this copy is designated as Development Software and its use is
* subject to the terms of the License Agreement attached to such Kit.
*
* (c) If this Sample Code is distributed independently, then the following
* terms apply:
*
* (d) This file may be freely copied and redistributed as long as:
* 1) Parts (a), (d), (e) and (f) continue to be included in the file,
* 2) If the file has been modified in any way, a notice of such
* modification is conspicuously indicated.
*
* (e) PostScript, Display PostScript, and Adobe are registered trademarks of
* Adobe Systems Incorporated.
*
* (f) THE INFORMATION BELOW IS FURNISHED AS IS, IS SUBJECT TO
* CHANGE WITHOUT NOTICE, AND SHOULD NOT BE CONSTRUED
* AS A COMMITMENT BY ADOBE SYSTEMS INCORPORATED.
* ADOBE SYSTEMS INCORPORATED ASSUMES NO RESPONSIBILITY
* OR LIABILITY FOR ANY ERRORS OR INACCURACIES, MAKES NO
* WARRANTY OF ANY KIND (EXPRESS, IMPLIED OR STATUTORY)
* WITH RESPECT TO THIS INFORMATION, AND EXPRESSLY
* DISCLAIMS ANY AND ALL WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR PARTICULAR PURPOSES AND NONINFRINGEMENT
* OF THIRD PARTY RIGHTS.
*/
/*
* ControlPointWraps.psw
*
* Version: 2.0
* Author: Ken Fromm
* History:
* 03-07-91 Added this comment.
*/
/* This wrap is called in the +new method to define and bind procedures. */
defineps PSWDefsContPts ()
/NOP {
} bind def
/SA { % x y sa x' y'
transform
0.25 sub round 0.25 add exch
0.25 sub round 0.25 add exch
itransform
} bind def
/RSA { %dx dy rsa dx' dy'
dtransform
round exch
round exch
idtransform
} bind def
/BRF{ %X Y
sa moveto -1.5 -1.5 rsa rmoveto 0 3 rsa rlineto
3 0 rsa rlineto 0 -3 rsa rlineto -3 0 rsa rlineto
closepath
} bind def
/BRS{ %X Y
sa moveto -2 -2 rsa rmoveto 0 4 rsa rlineto
4 0 rsa rlineto 0 -4 rsa rlineto -4 0 rsa rlineto
closepath
} bind def
/BX { % X Y
sa moveto -2 -2 rsa rmoveto 4 4 rsa rlineto
0 -4 rsa rmoveto -4 4 rsa rlineto
} bind def
/BC{ % X Y
sa moveto
0 2 rsa rmoveto 0 -4 rsa rlineto
-2 2 rsa rmoveto 4 0 rsa rlineto
} bind def
endps
/* Rounds the points passed in to device space. */
defineps PSWSetIndependent ( )
/sa /SA load def
/rsa /RSA load def
endps
/* Does not perform any adjustment to the points. */
defineps PSWSetDependent ( )
/sa /NOP load def
/rsa /NOP load def
endps
defineps PSWDefineFont(char *fontname)
8 dict dup begin
/FontName /fontname def
/FontType 3 def
/FontMatrix [.001 0 0 .001 0 0] def
/FontBBox [-500 -500 500 500] def
/Encoding 256 array def
0 1 255 {Encoding exch /.notdef put} for
Encoding
dup (a) 0 get /Rectfill put
dup (b) 0 get /Rectstroke put
dup (c) 0 get /Ximage put
(d) 0 get /Crossstroke put
/CharProcs 5 dict def
CharProcs begin
/.notdef { } def
/Rectfill {
-300 -300 sa moveto 0 600 rsa rlineto
600 0 rsa rlineto 0 -600 rsa rlineto closepath
fill
} def
/Rectstroke {
-400 -400 sa moveto 0 800 rsa rlineto
800 0 rsa rlineto 0 -800 rsa rlineto closepath
stroke
} def
/Ximage {
-500 -500 translate
1000 1000 scale
5 5 true [5 0 0 5 0 0] {<88 50 20 50 88>} imagemask
} def
/Crossstroke {
0 400 sa moveto 0 -800 rsa rlineto
-400 0 sa moveto 800 0 rsa rlineto
stroke
} def
end
/BuildChar { % font dict, char code
500 0 -750 -750 750 750 setcachedevice
exch begin
true setstrokeadjust
Encoding exch get
CharProcs exch get
exec
end
} def
end
/fontname exch definefont pop
endps